package com.yibo.support.pojo;

/**
 * 请求返回类型实现
 *
 * @param <T>   返回集实体
 */
public class Result<T> implements IResult<T> {

    /**
     * 返回状态代码  约束 0：表示成功  其他一律失败
     */
    private int code;

    /**
     * 消息
     */
    private String msg;

    /**
     * 数据集
     */
    private T  data;

    public Result(){

    }

    public Result(int code,String msg,T data){
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public Result(String msg,T data){
        this.code = 0;
        this.msg = msg;
        this.data = data;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }

    @Override
    public T getData() {
        return this.data;
    }
}
